import request from '@/axios'
import { AccountLoginType, UserType } from './types'
import { MenuSearchBo } from '@/api/menu/types'

export const loginApi = (data: UserType): Promise<IResponse<AccountLoginType>> => {
  return request.post({ url: '/sysAccount/login.adw', data })
}

export const loginOutApi = (): Promise<IResponse> => {
  const data = {}
  return request.post({ url: '/sysAccount/logout.adw', data })
}

export const getRoleMenuApi = (
  data: MenuSearchBo
): Promise<IResponse<AppCustomRouteRecordRaw[]>> => {
  return request.post({ url: '/sysMenu/roleMenuList.adw', data })
}
